package br.com.bacabeleireiros.sysbeleza.service.impl;

import java.io.Serializable;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import br.com.bacabeleireiros.sysbeleza.dao.IServicoDAO;
import br.com.bacabeleireiros.sysbeleza.entity.Servico;
import br.com.bacabeleireiros.sysbeleza.service.IServicoService;

@Service("servicoService")
public class ServicoServiceImpl implements IServicoService, Serializable {

	private static final long serialVersionUID = 1L;
	
	@Autowired
	private IServicoDAO dao;

	public ServicoServiceImpl() {
		
	}

	@Override
	@Transactional
	public Servico salva(Servico servico) {
		return dao.salva(servico);
	}

	@Override
	public Servico getById(Long id) {
		return dao.getById(id);
	}

	@Override
	@Transactional
	public void exclui(Servico servico) {
		servico = dao.getById(servico.getIdServico());
		dao.exclui(servico);
	}

	@Override
	public List<Servico> getAll() {
		return dao.getAll();
	}

	@Override
	public List<Servico> getListaServicoSelecionados(String servicoSelelcionado) {
		return dao.getListaServicoSelecionados(servicoSelelcionado);
	}

}
